The enhanced grid view is the core presentation and editing view of XML Spy. It shows the hierarchical structure of any XML-compliant document through a set of nested containers that can be easily expanded and collapsed to get a clear picture of the document's tree-like structure.
All items contained in an XML document are displayed in a structured way that allows for easy manipulation of contents and structure at the same time. Any hierarchical item (such as the XML declaration, document type declaration, or any element that contains child elements) is represented with a gray side bar and a tiny arrow at the top that can be expanded and collapsed as needed.
Display & Navigating
The contents of such a hierarchical item depend on its kind and - in the case of elements - mostly consist of attributes, character data, comments and child elements. To emphasize the strong coupling between attributes and the respective parent element, all attributes are always listed first and cannot be preceded by comments, character data or child elements. The order of the individual attributes is, however, preserved from the input file and can me modified if necessary.
Following the attributes, the remaining items within an element appear exactly in the order found in the file and can be rearranged without limitations using drag & drop.
If an element contains only character data, the data will be shown in the same line as the element and the element will not be considered hierarchical by nature. The character data for any other element will be shown indented with the attributes and potential child elements and will be labeled as "Text".
If an element is collapsed, its attributes can be shown in the same line in a different color. This attribute preview is especially helpful, when editing XML documents that contain a huge number of elements of the same kind that only differ by their contents and attributes (e.g. database-like applications).
The grid view can easily be customized using the mouse to adjust column widths. To resize a column to the width of its largest entry, just double-click on the grid line to the right of that column. Furthermore the Optimal widths command automatically adjusts all columns so that the currently visible contents of all items can be fully displayed. The heights of the cells are determined by their contents alone and cannot be adjusted by the user.
In addition to moving about with the mouse, you can also use the keyboard for navigating through an XML document in the enhanced grid view. The arrow keys move the selection in the tree and grid views and the + and - keys on the numeric keypad allow you to expand and collapse items.
Editing
When you are working on an XML document that is based on a DTD or Schema, the Enhanced Grid View provides many Intelligen Editing features based on the information gathered from the Schema or DTD.
Whenever you are editing the name of an element or attribute, a popup menu is automatically displayed the shows the available options depending on the position of the element you are editing and the content model defined by the Schema or DTD.
A similar popup is displayed, if the contents of an element or attribute are restricted by an enumeration or choice of some sorts. In all cases you can simply continue to type in the name and XML Spy will automatically choose the best match from the menu, which you can accept by hittin the Return key.
At the same time you'll also notice that the various Entry Helpers are constantly updated depending on the current selection in the Enhanced Grid Views and the Info Window shows important background information regarding the selected element or attribute.
In addition to the commands available through the menus and the toolbars, the enhanced grid view also provides a context-menu that is activated by using the right mouse-button, which contains the mose useful commands all in one conventien place:
|
|